def stockCalculator(stock):
    try:
        tran_amount = stock[1] * stock[2]
    except IndexError:
        print('列表中应包含股票代码、交易价格和交易金额。')
        tran_amount = 0
    except:
        print('发生了其他异常')
        tran_amount = 0
    else:
        print('程序正常运行, 没有发生异常')
    return (stock[0], tran_amount)

print(stockCalculator(['601998', 3.19, 100]))

print(stockCalculator(['601998', 3.19]))

print(stockCalculator(['601998', 3.19, '100']))
